package com.winit.base;

import java.sql.Connection;
import java.sql.PreparedStatement;

/**
 * Created by wangjian on 17/7/5.
 */
public class BaseUpdate {
    public static void updateT(Connection conn, String sql) {
        Long start = System.currentTimeMillis();
        try {
            PreparedStatement ps = conn.prepareStatement(sql);
            ps.executeUpdate();
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        } finally {
            Long end = System.currentTimeMillis();
            System.out.println("开始时间:" + start + ",结束时间:" + end + ".总用时:" + (end - start));
        }
    }
}
